package com.guohui.boot1.controller.api;

import java.util.List;

import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.guohui.boot1.entity.DemoUser;

public interface IUserController {

  @RequestMapping(method=RequestMethod.GET)
  public List<DemoUser> getUsers();
  
  @RequestMapping(value="/{id}",method=RequestMethod.GET)
  public DemoUser getUser(@PathVariable Long id);
  
  @RequestMapping(value="/add",method=RequestMethod.POST)
  public String addUser(@ModelAttribute DemoUser user);
  
  @RequestMapping(value="/update/{id}",method=RequestMethod.POST)
  public String updateUser(@PathVariable Long id,@RequestBody DemoUser user);
  
  @RequestMapping("/del/{id}")
  public String delUser(@PathVariable Long id);
  
  @RequestMapping(value="/clear",method=RequestMethod.GET)
  public String clear();
  
  
}
